﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ADDDF.Infrastructure
{
    public static class ValidEntity
    {
        public static void IfKeyNotNull(string name, IEntity value)
        {
            if (value == null)
                throw new InvalidValueException(name, "entity cannot be null");

            if (value.Key == null)
                throw new InvalidValueException(name, "Key of entity cannot be null");
        }
    }
}
